import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import 'element-plus/dist/index.css'; // element-plus 样式
import ElementPlus from 'element-plus'; // ElementPlus 组件引入
import * as ElementPlusIconsVue from '@element-plus/icons-vue' // ElementPlus字体图标引入
import { createPinia } from "pinia"; // pinia创建
import PiniaVuePluginPersistedstate from "pinia-plugin-persistedstate"; // pinia数据持久化插件

import 'normalize.css' // 重置浏览器默认样式
import 'nprogress/nprogress.css' //这个样式必须引入

import "@/styles/index.less"; // 引入自定义全局样式

const app = createApp(App);
const pinia = createPinia();

const setup = () => {
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
  pinia.use(PiniaVuePluginPersistedstate);
  app
    .use(ElementPlus)
    .use(pinia)
    .use(router)
    .mount("#app")
};

setup();
